# -*- coding: utf-8 -*-
#
# Author:: Jonny
# Date:: 2022/6/25
from time import sleep

from submodules.common.config.private.email_key import EMAIL_KEY_bjhanjf
from submodules.common.lib import datetime_
from submodules.common.lib.email_ import send_email_text


def send_email_remind():
    email_info_ = {
        "sender_config_list": [
            {
                "sender": "bjhanjf@163.com",
                "smtp_server": "smtp.163.com",
                "key": f"{EMAIL_KEY_bjhanjf}",
            },
            # {"sender": "bjhanjf2@163.com", "smtp_server": "smtp.163.com", "key": f"{EMAIL_KEY_bjhanjf2}"},
            # {"sender": "401834804@qq.com", "smtp_server": "smtp.qq.com", "key": f"{EMAIL_KEY_401834804}"}
        ],
        "receivers": ["401834804@qq.com"],
        "to": "401834804@qq.com,bjhanjf@163.com",  # to中要加上sender，否则会识别为垃圾邮件~
        # "cc": "2249470420@qq.com",
        # "bcc": "2563660939@qq.com",
        "subject": [f"验证码识别异常{datetime_.get_timestamp_human()}", "utf-8"],
        "text": f"""验证码识别异常{datetime_.get_timestamp_human()}""",
    }
    for i in range(6):
        send_email_text(**email_info_)
        sleep(10)


if __name__ == "__main__":
    send_email_remind()
